package com.stu.tools;

import com.stu.po.Students;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReData {
    private String msg;
    private Integer code;
    private long count;

    private List<Students> data;

    public ReData(String msg, Integer code) {
        this.code = code;
        this.msg = msg;
    }

    public ReData(String msg, Integer code, Integer count) {
        this.code = code;
        this.msg = msg;
        this.count = count;
    }

    public static ReData getTrue(String msg) {
        return new ReData(msg, 0, 1);
    }

    public static ReData getTrue(String msg, List<Students> data) {
        return new ReData(msg, 0, 1, data);
    }

    public static ReData getTrue(String msg, long count, List<Students> data) {
        return new ReData(msg, 0, count, data);
    }

    public static ReData getFalse(String msg) {
        return new ReData(msg, 1, 0);
    }

}
